//
//  YWLittleVideoPlayerView.h
//  YueshengToutiao
//
//  Created by yellow on 2021/4/21.
//  Copyright © 2021 YW. All rights reserved.
//

#import <UIKit/UIKit.h>


NS_ASSUME_NONNULL_BEGIN
@class YWLittleVideoPlayerView,YWGetNewsDataStatus;

@protocol  YWLittleVideoPlayerViewDelegate <NSObject>

@optional

//跳去详情都用这代理 (videoView里面的index和urlString都可以用的)
-(void)videoViewDidTap:(YWLittleVideoPlayerView *)videoView;

//开始成功代理
-(void)videoViewDidStartPlay:(YWLittleVideoPlayerView *)videoView;

//停止成功代理
-(void)videoViewDidSotpPlay:(YWLittleVideoPlayerView *)videoView;



@end
@interface YWLittleVideoPlayerView : UIView


@property(nonatomic,strong)YWGetNewsDataStatus *status;


+(instancetype)littleVideoPlayerView;

//播放器是否正在播放 （这个是暂停播放也算是NO的）
@property (nonatomic, assign) BOOL isPlaying;

//播放器是否正在播放 （这个是暂停播放也算是YES的\暂停播放也叫正在播放）
@property (nonatomic, assign,readonly) BOOL isPlaying_containPause;

//只读、假如设置请用播放方法那里的参数
@property(nonatomic,copy,readonly)NSString *urlString;


//开始
-(void)startPlayWithUrl:(NSString *)urlString withMute:(BOOL)mute;

//去其它view继续播放，不要先停止之前正在播放的
-(void)continuePlayWithAnthorViewWithUrl:(NSString *)urlString WithMute:(BOOL)mute;

//停止
-(void)stopPlay;

- (void)snapshot:(void (^)(UIImage *))snapshotCompletionBlock;


//暂停
-(void)pausePlay;

//继续
-(void)continuePlay;

@property (nonatomic, weak) id<YWLittleVideoPlayerViewDelegate>delegate;

//记录列表第几个indexPath.row 
@property(nonatomic,assign)NSInteger index;


@end

NS_ASSUME_NONNULL_END
